<?php
class UsersController extends AppController {

    var $name = 'Users';    
    var $components = array('Auth'); // Not necessary if declared in your app controller
    
    function beforeFilter() {
        $this->Auth->allow('register');
		}

 
    /**
     *  The AuthComponent provides the needed functionality
     *  for login, so you can leave this function blank.
     */
    function login() {
    	}

    function logout() {
        $this->redirect($this->Auth->logout());
    	}
    
    function register() {
	    if ($this->data) {
    	    if ($this->data['User']['password'] == $this->Auth->password($this->data['User']['psword'])) {
        	    $this->User->create();
            	$this->User->save($this->data);
				}
			}
		}
}
?>